package com.qf.controller;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.qf.pojo.User;
import com.qf.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class UserController {
    private IUserService userService;

    @Autowired
    public void setUserService(IUserService userService) {
        this.userService = userService;
    }

    @RequestMapping("/user/{id}")
    public User getUserById(@PathVariable Long id) throws JsonProcessingException {
        System.out.println("ddddddd");
       return userService.findUserByID(id);
    }
}
